feat(spp_demo): curated PHL geodata + spp_demo_phl_luzon demo module (re-land from #76)#277
feat(spp_demo): curated PHL geodata + spp_demo_phl_luzon demo module (re-land from #76)#277gonzalesedwin1123 wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a geodata preparation script (prepare_phl_geodata.py) and updates the spp_demo module with refreshed Philippine geodata using PSA/HDX p-codes. It also introduces a new companion module, spp_demo_phl_luzon, which provides Luzon-scale demo areas, population weights, and an area loader. The review feedback highlights three key improvements: optimizing an N+1 query pattern in the Luzon area loader's shape-loading method, wrapping the streaming HTTP request in a context manager to prevent connection leaks, and updating the script's documented dependencies to include pandas and openpyxl so that population data processing does not silently fail.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
… module (from #76) Re-lands the PHL demo data portion of reverted PR #76: curated PHL geojson shapes and areas, demo data generator and area loader test updates, the prepare_phl_geodata.py preparation script, and the new spp_demo_phl_luzon module (Luzon demo areas + population weights). Files restored verbatim from the pre-revert merged state (8bf9a3a). spp_demo bumped to 19.0.2.1.0 with a HISTORY entry.
32a47c5 to
537b32e
Compare
- area_loader: batch-fetch areas by code instead of per-feature search (N+1 over ~700 Luzon features). - prepare_phl_geodata.py: close streamed download via context manager; usage docs include pandas/openpyxl needed for population weights.
|
All three gemini-code-assist findings applied (commit 91c9e06): batched area lookup replacing the per-feature N+1 search, streamed download wrapped in a context manager, and usage docs now include pandas/openpyxl. |
Re-lands the PHL demo-data portion of reverted PR #76 (revert: #271). Everything listed is contained in THIS PR's diff.
Summary
spp_demo: curated PHL shapes/areas (phl_curated.geojson,areas.xml) and demo generator updates.spp_demo_phl_luzonmodule: Luzon administrative areas, population weights, area loader (depends on spp_demo's loader changes).scripts/prepare_phl_geodata.py: the script that generates the curated geodata.Added on top of #76 (not in the original)
Verification
./spp t spp_demo: 121 passed, 0 failed./spp t spp_demo_phl_luzon: 17 passed, 0 failed